package com.bdqn.service;

import com.bdqn.mapper.CheckinMapper;
import com.bdqn.pojo.Checkin;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class CheckinServiceImpl implements CheckinService{

    @Resource
    private CheckinMapper checkinMapper;

    /**
     * 入住信息搜索查询
     * @param queryMap
     * @return
     */
    @Override
    public List<Checkin> findList(Map<String, Object> queryMap) {
        return checkinMapper.findList(queryMap);
    }

    /**
     * 模糊搜索总条数
     * @param queryMap
     * @return
     */
    @Override
    public Integer getTotal(Map<String, Object> queryMap) {
        return checkinMapper.getTotal(queryMap);
    }

    /**
     * 获取单人入住信息
     * @param id
     * @return
     */
    @Override
    public Checkin find(Long id) {
        return checkinMapper.find(id);
    }

    /**
     * 按月获取统计信息
     * @return
     */
    @Override
    public List<Map> getStatsByMonth() {
        return checkinMapper.getStatsByMonth();
    }

    /**
     * 按日获取统计信息
     * @return
     */
    @Override
    public List<Map> getStatsByDay() {
        return checkinMapper.getStatsByDay();
    }

    /**
     * 入住插入操作
     * @param checkin
     * @return
     */
    @Override
    public int add(Checkin checkin) {
        return checkinMapper.add(checkin);
    }

    /**
     * 入住编辑操作
     * @param checkin
     * @return
     */
    @Override
    public int edit(Checkin checkin) {
        return checkinMapper.edit(checkin);
    }

    /**
     * 入住删除操作
     * @param id
     * @return
     */
    @Override
    public int delete(Long id) {
        return checkinMapper.delete(id);
    }
}
